﻿@model RuTracker.MVC.Models.Tracker.TrackerModel
@using RuTracker.MVC.Core.HtmlHelpers;
@using RuTrackerLib

@{
    Layout = null;
}

<!DOCTYPE html>

<html>
<head>
    <meta name="viewport" content="width=device-width" />
    <link href="@Url.Content("~/Styles/style.css")" rel="stylesheet" type="text/css" />
    <title>Tracker</title>
</head>
    <body>
        @using(Html.BeginForm())
        {
            <div>
                <div class="topmenu">
                    <table style="width: 100%" border="1">
                        <tr>
                            <td>
                                <h3>Action name</h3>
                            </td>
                            <td>
                                <h3>Action</h3>
                            </td>
                            <td>
                                <h3>Description</h3>
                            </td>
                        </tr>
                        
                        @if (Model.IsTorrentAvailable)
                        {
                            <tr>
                                <td>
                                    <p>Download torrent file to Dropbox folder</p>
                                </td>
                                <td>
                                    @Html.ActionLink("Download", "DownloadTorrentFileToDropboxFolder", "Processing", new {id = Model.Url}, new {@class = "actionlink-download-torrent-to-dropbox"})
                                </td>
                                <td>
                                    @if (Model.IsTorrentDownloaded)
                                    {
                                        <div class="downloaded-torrent">
                                            Downloaded on @Model.UserTorrent.DownloadedDate.ToString("dd/MM/yyyy hh:mm:ss")
                                        </div>
                                    }
                                </td>
                            </tr>
                        }
                    </table>
                </div>

                <div class="topmenu">
                    <table width="100%">
                        <tbody>
                            <tr>
                                <td width="20%">
                                    @Html.ActionLink(Model.User, "Index", "Settings")
                                    @Html.ActionLink("[Sign out]", "Logout", "Authorize")
                                </td>
                                <td style="padding: 2px;">
                                    <div>
                                        @Html.TextBoxFor(x => x.SearchQuery, new { @class = "textbox-search" })
                                        <input type="submit" value="Search"/>
                                    </div>
                                </td>
                            </tr>
                        
                        </tbody>
                    </table>
                </div>
                <div>
                    <div style="width: 100%; height: 100%;">
                        @Html.DisplayHtml(Model.Html);
                    </div>
                </div>
        
            </div>
        }
    </body>
</html>
